-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate ntuple(::Integer, ::Function) #11486
Conversation
Some day we will want to duck-type the Function argument to ntuple, but we need one release cycle with a deprecation warning before we can do that. So let's do the deprecation now.
It's inferrable with Functors and FastAnonymous, but not (currently) generic functions.
Since little controversy seems to have been stirred up, and approval for the general idea was given in #9961, merging. |
Deprecate ntuple(::Integer, ::Function)
Since ntuple got deprecated, I think someone should modify the ndgrid.jl file in the examples directory.
|
Fixed in 85e3fe0. If you noticed this because you use |
Hm. Why didn't Line 23 in 85e3fe0
|
@tkelman In the examples.jl, the call to ndgrid was 2 AbstractVectors. The warning would only appear if the call has 3 or more of them. |
I think we should do this now, because someday we may want to duck-type the function argument (FastAnonymous or otherwise). But we need one release cycle of deprecation first.
More controversially, I also added an inferrable variant of
ntuple
. It's based onVal
and@generated
functions, the latter of which is the likely source of controversy. I separated this into a separate commit so that it can be easily dropped, if necessary.